package com.mofang.activity.user;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mofang.MoFangApplication;
import com.mofang.R;
import com.mofang.activity.BaseTitleViewActiviey;
import com.pactera.framework.util.ToastHelper;

public class ChangeBankAccountActivity extends BaseTitleViewActiviey implements
		OnClickListener {

	public static final int code_select_bank_name=0;
	private EditText enterNo_edit;// 输入银行卡号
	private EditText enterName_edit;// 输入银行账号姓名
	private EditText enterTel_edit;// 输入银行卡的联系方式
	private TextView selextBankName_text;// 选择银行卡开户行
	private LinearLayout selextBankName_ly;
	private LinearLayout change_card_no_ly;// 确定

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.activity_change_bank_account);
		setNavigationTitle("更改我的银行账户");
		setNavigationLeftBtnImage(R.drawable.return_arrow);
		super.onCreate(savedInstanceState);

	}

	@Override
	protected void initView() {
		super.initView();

		enterNo_edit = (EditText) findViewById(R.id.changecardno_enterNo_edit);

		enterName_edit = (EditText) findViewById(R.id.changecardno_enterName_edit);

		enterTel_edit = (EditText) findViewById(R.id.changecardno_enterTel_edit);

		selextBankName_text = (TextView) findViewById(R.id.changecardno_selextBankName_text);

		selextBankName_ly = (LinearLayout) findViewById(R.id.changecardno_selextBankName_ly);
		selextBankName_ly.setOnClickListener(this);

		change_card_no_ly = (LinearLayout) findViewById(R.id.change_card_no_ly);
		change_card_no_ly.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent;
		switch (v.getId()) {
		case R.id.changecardno_selextBankName_ly:

			 intent = new Intent(getApplicationContext(),
			 BankNameSelectActivity.class);
			 startActivityForResult(intent, code_select_bank_name);

			break;
		case R.id.change_card_no_ly:

//			intent = new Intent(getApplicationContext(),
//					MyBankAccountActivity.class);
//			startActivity(intent);
			finish();
			break;

		default:
			break;
		}
	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if(resultCode==RESULT_OK)
			if (requestCode==code_select_bank_name) {
				int id=data.getExtras().getInt("id");  
				ToastHelper.getInstance().showLongMsg(""+id);
			}
	
	}
}
